<? 
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";

	if(isset($_POST['btnsubmit']))
	{
		require("required/dbconnect.php");
		$contact_number=$_POST['contact_number'];
		$email=$_POST['email'];
		$email_hidden=$_POST['email_hidden'];
		$address1=$_POST['address1'];
		$address2=$_POST['address2'];
		$fax=$_POST['fax'];
		$website=$_POST['website'];
		$logo_url=$_POST['logo_url'];
		$website_name=$_POST['website_name'];
		$paypal_emailaddress=$_POST['paypal_emailaddress'];
		$paypal_submit_url=$_POST['paypal_submit_url'];
		
		$update=mysql_query("update os_contactinfo set contact_number='$contact_number',email='$email',email_hidden='$email_hidden',address1='$address1',address2='$address2',fax='$fax',website='$website',website_name='$website_name',logo_url='$logo_url',paypal_emailaddress='$paypal_emailaddress' where id=1");
		
		
		header("Location:contact.php?msg=1");
	}
	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	

	if(empty($_GET['msg']))
	{
		$msg="";
	}
	else
	{
		$msg="<font color=green>Data updated!</font>";
	}
	
	
	$get_info=mysql_query("select * from os_contactinfo where id=1");
	
	$a=mysql_fetch_array($get_info,MYSQL_ASSOC);
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>
	
	<td valign="top">
			<?= $msg ?>
			<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
			<table width="100%" class="solidborder">
				<td width="17%"><strong>Contact Details</strong></td>
				<tr>
					<td>Address</td><td width="83%"><input type="text" value="<?= $a['address1'] ?>" name="address1" maxlength="200" size="50"></td>
				</tr>
				<tr>
					<td></td><td width="83%"><input type="text" value="<?= $a['address2'] ?>" name="address2" maxlength="200" size="50"></td>
				</tr>
				<tr>
					<td>Contact number</td><td width="83%"><input type="text" value="<?= $a['contact_number'] ?>" name="contact_number" maxlength="20" size="20"></td>
				</tr>
				<tr>
					<td>Fax</td><td width="83%"><input type="text" value="<?= $a['fax'] ?>" name="fax" maxlength="20" size="20"></td>
				</tr>
				<tr>
					<td>Email (publish)</td><td><input type="text" value="<?= $a['email'] ?>" name="email" maxlength="200" size="80"></td>
				</tr>
				<tr>
					<td>Email (receiving enquiries)</td><td><input type="text" value="<?= $a['email_hidden'] ?>" name="email_hidden" maxlength="200" size="80"></td>
				</tr>
				<tr>
					<td>Website URL</td><td><input type="text" value="<?= $a['website'] ?>" name="website" maxlength="100" size="30"></td>
				</tr>
				<tr>
					<td>Website's Name</td><td><input type="text" value="<?= $a['website_name'] ?>" name="website_name" maxlength="100" size="30"></td>
				</tr>
				<tr>
					<td>Email's Logo URL</td><td><input type="text" value="<?= $a['logo_url'] ?>" name="logo_url" maxlength="100" size="30"></td>
				</tr>
				<tr>
					<td colspan="3"><img src="../images/p1.gif" align="absmiddle"> Setting</td>
				</tr>
				<tr>
					<td>Paypal Email Address</td><td><input type="text" value="<?= $a['paypal_emailaddress'] ?>" name="paypal_emailaddress" maxlength="100" size="30"></td>
				</tr>
				<tr>
					<td>Paypal Submit URL</td><td><input type="text" value="<?= $a['paypal_submit_url'] ?>" name="paypal_submit_url" maxlength="100" size="30">
					<br>
					Paypal sandbox : https://www.sandbox.paypal.com/cgi-bin/webscr<br>
					Paypal live : https://www.paypal.com/cgi-bin/webscr
					</td>
				</tr>
				<td width="17%">
					
					<input type="submit" value="Save" class="button" name="btnsubmit">
				</td>
			</table>
			</form>
		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

